home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 39 / 039.d81 / midi hacker (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  5KB  |  151 lines

  1. 40 print"[147]":poke53280,0:poke53281,0:dimst$(17)
  2. 41 a$="please stand by ...."
  3. 43 forx=1to500:next
  4. 45 print"[147][151]"a$:forx=1to25:next
  5. 46 print"[152]"a$:forx=1to25:next
  6. 47 print"[155]"a$:forx=1to25:next
  7. 48 print""a$:forx=1to25:next
  8. 59 fori=1to17:readst$(i):next
  9. 60 ck=0:rem initialize checksum
  10. 70 fori=828to909:readx:pokei,x:rem poke ml routine
  11. 80 ck=ck+x
  12. 90 next
  13. 91 print"[155]"a$:forx=1to25:next
  14. 92 print"[152]"a$:forx=1to25:next
  15. 93 print"[151]"a$:forx=1to25:next
  16. 94 print"[147]":forx=1to500:next
  17. 100 :
  18. 101 print"[147]";:gosub 60600:forx=1to3000:next:gosub60860
  19. 102 geta$:ifa$=""then 102
  20. 103 ifa$="p"ora$="[208]"then wh$=a$:goto 110
  21. 104 ifa$="s"ora$="[211]"then wh$=a$:goto 110
  22. 105 ifa$=chr$(13) then gosub 61000
  23. 106 goto 102
  24. 110 gosub 61500
  25. 115 open5,dv:print#5:print#5
  26. 120 ifwh$="s"thenwh=1:goto160
  27. 130 ifwh$="p"thenwh=2:poke832,8:poke832,9:goto160:rem passport registers
  28. 140 :
  29. 150 rem setup and initialization for sequential and passport interfaces
  30. 160 cr(1)=56832:cr(2)=56840:rem control registers
  31. 170 rs(1)=3:rs(2)=19:rem master reset
  32. 180 in(1)=149:in(2)=145:rem receive interrupts
  33. 190 bu=866  :rem location of ml routine to get data
  34. 200 mb=825  :rem location of current midi byte
  35. 210 rem *** initialize ***
  36. 220 poke251,0:poke252,192:rem poke lo,hi bytes of start of buffer (49152)
  37. 230 poke826,0:poke827,0:rem store starting values of buffer pointers
  38. 240 pokecr(wh),rs(wh):rem master reset
  39. 250 pokecr(wh),in(wh):rem receive interrupts from midi
  40. 260 poke56333,127:rem disable interrupts
  41. 270 poke788,60:poke789,3:rem store address of new interrupt routine
  42. 280 poke56333,129:rem restore interrupts
  43. 290 rem *** read midi device ***
  44. 300 print"[147]":ifdv=4thenprint"running...."
  45. 301 print#5," now listening for midi data         "
  46. 310 print#5,"     press space to abort to menu      "
  47. 320 geta$:ifa$=chr$(32)then print#5:print#5:close5:goto101
  48. 330 sysbu:b=peek(mb)
  49. 340 ifb<128thenprint#5,b;:goto320:rem <128 for data bytes
  50. 350 ifb=254then320:rem end
  51. 360 print#5
  52. 370 ifb>239then420:rem <240 for channel messages
  53. 380 t=((b and 112)/16)+1:ch=(b and 15)+1
  54. 390 print#5,st$(t);", ch #";ch;
  55. 400 goto320
  56. 410 rem system messages
  57. 420 ifb=240thenprint#5,st$(8);:goto320
  58. 430 ifb=242thenprint#5,st$(9);:goto320
  59. 440 ifb=243thenprint#5,st$(10);:goto320
  60. 450 ifb=246thenprint#5,st$(11);:goto320
  61. 460 ifb=247thenprint#5,st$(12);:goto320
  62. 470 ifb=250thenprint#5,st$(13);:goto320
  63. 480 ifb=251thenprint#5,st$(14);:goto320
  64. 490 ifb=252thenprint#5,st$(15);:goto320
  65. 500 ifb=255thenprint#5,st$(16);:goto320
  66. 510 print#5,st$(17);:goto320
  67. 520 data"note off","note  on","poly pressure","control change"
  68. 530 data"program change","channel pressure","pitch bend"
  69. 540 data"sysex start","song pointer","song select","tuning command"
  70. 550 data"sysex end"
  71. 560 data"start","continue","stop","reset","undefined"
  72. 570 data72,152,72,173,2,222,74,176
  73. 580 data3,76,92,3,173,3,222,201
  74. 590 data254,240,13,201,248,240,9,141
  75. 600 data56,3,32,122,3,76,63,3
  76. 610 data104,168,104,76,49,234,173,58
  77. 620 data3,205,59,3,208,6,169,254
  78. 630 data141,57,3,96,168,177,251,238
  79. 640 data58,3,141,57,3,96,172,59
  80. 650 data3,200,152,136,205,58,3,240
  81. 660 data3,141,59,3,173,56,3,145
  82. 665 data251,96
  83. 60600 print""
  84. 60610 print:poke53280,14:poke53281,14
  85. 60630 print"  [223][223][146]  [223]  [223][146][223]  [223][146][223]  [223][146][223]  [223][146][223]   [223][146][223]  [223][146][223]  [223]"
  86. 60640 print"   [223][223][146]  [223][223][146][223][223][146][223][223][146][223][223][146][223][223][146][223][223][146][223][223][146]   [223][223][146]  [223][223][146][223][223][146][223][223][146][223][223]"
  87. 60650 print"    {$7f}{$7f}[146]  {$7f}{$7f}[146]{$7f}{$7f}[146]{$7f}{$7f}[146]{$7f}{$7f}[146]{$7f}{$7f}[146]{$7f}{$7f}[146]{$7f}  {$7f}[146] {$7f}{$7f}[146]  {$7f}{$7f}[146]{$7f}{$7f}[146]{$7f}{$7f} "
  88. 60660 print"     {$7f}{$7f}[146]  {$7f}{$7f}[146]{$7f}{$7f}[146]{$7f}  {$7f}[146]{$7f}{$7f}[146]{$7f}{$7f}[146]  {$7f}{$7f}[146] {$7f}{$7f}[146]  {$7f}  {$7f}[146]{$7f} [164]{$7f}"
  89. 60670 print"      {$7f}  {$7f}[146]{$7f}  {$7f}[146]{$7f}{$7f}[146]{$7f}{$7f}[146]{$7f}  [146] {$7f}  {$7f}[146] {$7f}{$7f}[146]  {$7f}{$7f}[146]{$7f}{$7f}[146]{$7f}{$7f}[146]{$7f}{$7f}"
  90. 60680 print"                                     "
  91. 60690 print"                                     "
  92. 60700 print"               presents .....         "
  93. 60701 print"                                  "
  94. 60710 print"          [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]   "
  95. 60720 print"         [176][177][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][177][174]   "
  96. 60730 print"        [176][179]                      [171][174]   "
  97. 60740 print"        [221][221]     midi hacker      [221][221]  "
  98. 60750 print"        [221][221]                      [221][221]  "
  99. 60760 print"        {$7d}{$7d}         by           {$7d}{$7d}"
  100. 60770 print"        {$7d}{$7d}                      {$7d}{$7d}"
  101. 60780 print"        {$7d}{$7d}   david r. brooks    {$7d}{$7d}"
  102. 60785 print"        [221][221]                      [221][221]"
  103. 60786 print"        [221][221]       (c) 1987       [221][221]"
  104. 60790 print"        [173][179]                      [171][189]"
  105. 60800 print"         [173][178]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[178][189]"
  106. 60810 print"          [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  107. 60850 return
  108. 60860 print""
  109. 60870 print"                          [146]"
  110. 60880 print"           menu            [146]"
  111. 60881 print"                           [146]"
  112. 60882 print"  which interface are you [174][146]"
  113. 60883 print"                          [171][146]"
  114. 60884 print"          using ?         [221][146]"
  115. 60885 print"                          [221][146]"
  116. 60886 print" p)assport or s)equential [221][146]"
  117. 60887 print"                          [221][146]"
  118. 60888 print"   press return to exit   [221][146]"
  119. 60889 print"                          [221][146]"
  120. 60890 print" [221][221]       (c) 1987       [221][146]":return
  121. 61000 print"[145][145][145]    are you sure (y/n)    [146]"
  122. 61010 geta$:ifa$=""then 61010
  123. 61015 ifa$="n"ora$="[206]"  then 60860
  124. 61017 ifa$="y"ora$="[217]"then 61020
  125. 61018 goto 61010
  126. 61020 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  127. 61021 ifer<>63 then print"[147]":end
  128. 61023 load"hello connect",8
  129. 61500 gosub60600:print""
  130. 61510 print"                     [146]
  131. 61512 [153]"     output to       tanwait
  132. 61513 print"                      [146]
  133. 61514 [153]" s)creen or p)rinter  wait
  134. 61515 print"                      [146]
  135. 61516 [153]"         by          wait
  136. 61520 geta$:ifa$=""then 61520
  137. 61530 ifa$="s"ora$="[211]" then dv=3:return
  138. 61540 ifa$="p"ora$="[208]" then dv=4:goto61550
  139. 61545 goto 61520
  140. 61550 open15,dv,15:close15:ifst=0then return
  141. 61560 gosub60600:print""
  142. 61562 print"                   [192]"
  143. 61565 print" printer not ready  "
  144. 61566 print"                    "
  145. 61568 print"  press (return)    "
  146. 61569 print"                    "
  147. 61570 print"                   "
  148. 61575 geta$:ifa$=""then61575
  149. 61577 ifa$=chr$(13) then gosub60600:goto61500
  150. 61589 goto 61575
  151.